#!/usr/bin/python
import facebook
# Replace these with your app's credentials
api_key = 'YOUR_API_KEY'
secret_key = 'YOUR_SECRET_KEY'

client = facebook.Facebook(api_key, secret_key) #FIRST
client.auth.createToken() #SECOND
client.login() #THIRD

print '[*] Please login / give permission application to access you . Then press enter key to continue...',
raw_input()
try:

	client.auth.getSession() #FOURTH

	client.request_extended_permission("publish_stream", popup=False) #only needs to be ran first time
	raw_input()   

	cek = client.status.set("Testing update status using facebook API with pyfacebook") #LAST

except facebook.FacebookError, e:
	print "ERROR", e    
